package com.hqyj.controller;

import com.hqyj.pojo.Department;
import com.hqyj.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;


@RestController
@RequestMapping("/department")
public class DepartmentController {
    @Autowired
    DepartmentService departmentService;

    //加载表格数据
    @RequestMapping("/departmentList")
    public HashMap<String,Object> listPage(Department d){
        return departmentService.select(d);
    }
    //修改
    @RequestMapping("/update")
    public HashMap<String,Object>  update(Department d){
        return departmentService.update(d);
    }
    //新增
    @RequestMapping("/add")
    public HashMap<String,Object> add(Department d){
        return departmentService.add(d);
    }

    //删除
    @RequestMapping("/del")
    public HashMap<String,Object> del(Integer id){ return departmentService.del(id); }

}
